# import cv2
# import numpy as np
#
# # 创建Haar级联器
# faces = cv2.CascadeClassifier("D:\\Users\\pyfangyao\\opencv\\haarcascades\\haarcascade_frontalface_default.xml")
#
# # 导入图片并灰度化
# img = cv2.imread("C:\\Users\\86191\\Pictures\\Saved Pictures\\Camera Roll\\face.jpg")
# gary = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
#
# # 检测人脸
# face = faces.detectMultiScale(gary,1.1,3)
# for (x,y,w,h) in face:
#     cv2.rectangle(img,(x,y),(x+w,y+h),(0,255,0),2)
#
# cv2.imshow("face",img)
# cv2.waitKey(0)

